package com.github.caijh.mall.validatecode.controller;

import com.github.caijh.mall.validatecode.model.ValidateCode;
import com.github.caijh.mall.validatecode.service.ValidateCodeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@Slf4j
@RestController
@RequestMapping("api/admin/validate/code")
@Api(tags = "验证码服务")
public class ValidateCodeController {

    @Autowired
    private ValidateCodeService validateCodeService;

    /**
     * 获取图片验证码
     *
     * @return CommonResult
     * @author Mr.Zhang
     * @since 2020-04-16
     */
    @ApiOperation(value = "获取验证码")
    @GetMapping(value = "/get")
    public ValidateCode get() {
        return validateCodeService.get();
    }

}



